package blog.service;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;

import blog.dao.UserDao;
import blog.domain.User;

@Service
@Transactional(propagation = Propagation.REQUIRED)
public class UserService {
	@Resource
	private UserDao userDao;

	public void setUserDao(UserDao userDao) {
		this.userDao = userDao;
	}

	public User getUser(String username) {
		return userDao.getUser(username);
	}

	public boolean validateUser(String username, String password) {
		return userDao.validateUser(username, password);
	}
}
